package main

import "fmt"

func main() {
	ch := make(chan string)
	fmt.Println("len(ch)=", len(ch), "cap(ch)=", cap(ch))
	go func() {
		for i := 0; i <= 2; i++ {
			fmt.Println("i = ", i, "len(ch)=", len(ch), "cap(ch)=", cap(ch))
		}
		// 通知主go打印完毕
		ch <- "子go打印完毕"
	}()
	str := <-ch
	fmt.Println("str=", str)
}
